﻿//window指针
var windowPointer = function () {
    pointer.apply(this, arguments);
    this.o(window);
    if (window.frameElement && window.frameElement.contentWindowUpPointerid) {
        this.up(window.frameElement.contentWindowUpPointerid);
    }
    if (window.frameElement && window.frameElement.contentWindowPointerid) {
        this.id(window.frameElement.contentWindowPointerid);
    }
    if (window.frameElement && window.frameElement.contentWindowPointerDownintent) {
        this.downintent(window.frameElement.contentWindowPointerDownintent);
    }

    this.listen(intent.action.refresh, function (_this, _arg) {
        _this.o().location.reload(false);
    });
    this.listen(intent.action.focus, function (_this, _arg) {
        if (_this.state("_contontdata")) {
            _this.notify(intent.action.refresh);
            _this.state("_contontdata", false);
        }
    });
    this.listen(intent.action.dataischange, function (_this, _arg) {
        _this.state("_contontdata", true);
    });
    this.listen(intent.action.fill, function (_this, _arg) {
        if (typeof (_arg) == "string") {
            $("html", $(_this.o().document)).html(_arg);
        }
        if (_arg.to) {
            $(_arg.to, $(_this.o().document)).html(_arg.content);
        }
    });
};
var mWindowPointer = new windowPointer();
